package cn.shengongying.dao;

import cn.shengongying.model.Information;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户消息信息 Mapper 接口
 * </p>
 *
 * @author RXK
 * @since 2022-01-12
 */
@Repository
public interface InformationMapper extends BaseMapper<Information> {

    int findByUserIdAndSourceIdAndDate(@Param("userId") Long userId, @Param("sourceId") Long sourceId, @Param("type") int type);

    void save(@Param("informationList") List<Information> informationList);

    List<Information> findByUserIdAndType(@Param("userId") Long userId, @Param("type") Integer type, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);

    Map<Integer, Integer> statistic(@Param("userId") Long userId);

    void create(Information information);
}
